home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor2 / htrim.doc < prev    next >
Internet Message Format  |  1995-03-31  |  7KB

  1. From: Simone.Rapisarda@f612.n332.z2.fidonet.org (Simone Rapisarda) 
  2. Newsgroups: comp.sys.hp48 
  3. Subject: HTRIM: a variables hider (!!!) 
  4. Message-ID: <101871.2B5606CE@wolf.sublink.org> 
  5. Date: 14 Jan 93 19:39:40 GMT 
  6. Sender: ufgate@wolf.sublink.org (newsout1.26) 
  7. Organization: FidoNet node 2:332/612 - WolfNet Line #1 [SD, Pisa I 
  8. Lines: 113 
  9.  
  10. Dear netters, 
  11. I'm writing this article to present to you a program that I have 
  12. written,I call it HTRIM. 
  13.  
  14. First of all I must say that till now I have been unable to read this 
  15. newsgroup for a long time so I really don't know if a similar program 
  16. has been already written. If so, I'm very sorry of bothering you. 
  17.  
  18. HTRIM is a sys-RPL program that I use to hide variables in the HOME 
  19. directory so to keep it a clean and tidy (yes, you've read well: HOME 
  20. directory, not Hidden directory!). 
  21.  
  22. It uses a feature that Bill Wickes, writing about it a long time 
  23. ago, never called 'dangerous', so I assume that this program will work 
  24. under every circumstance, but who knows? 
  25.  
  26. I really would like to receive a 'last word' from Mr. Wickes on this 
  27. topic. 
  28.  
  29. The feature I'm talking about is the one that allows you to have in a 
  30. directory different variables with the very same name (to do this you 
  31. can use the sys-RPL command CREATE). 
  32.  
  33. Mr. Wickes wrote that only the first occurrence of the variable is 
  34. used when you recall, eval or purge it. This is true but, as often 
  35. happens,there is an exception: The Hidden dir in the HOME directory. 
  36. Infact, as far as I know, it is always accessed using a special 
  37. instruction (SetHiddenRes) and not by evaluating its name (the null 
  38. name). So it's possible to create in the HOME directory other 
  39. variables with a null name without causing problems to the operating 
  40. system. This goes together with the fact that the VAR menu ends when 
  41. it meets a null named variable, so does the command VARS too. 
  42.  
  43.  
  44. Here are some notes on HTRIM: 
  45.  
  46. HTRIM is distributed in the hope that it will be useful; even if it 
  47. has been tested (on a HP48 revision E) it makes use of undocumented 
  48. features,so use it at your own risk: I take no responsibility for any 
  49. damage caused by its use or misuse. HTRIM and this article are 
  50. Copyright (C) 1993 by Simone A. Rapisarda. Non-commercial distribution 
  51. is allowed and encouraged if this article, unchanged, accompanies the 
  52. unmodified program. 
  53.  
  54. HTRIM has been validated on an HP48 revision E. It should work fine 
  55. for HP48 revisions A through E. It may not work correctly for later 
  56. HP48 revisions. 
  57.  
  58. HTRIM is also a command in the SmartKeys library [see SMTK.LIB on this 
  59. disk.  -jkh-]. You can use HTRIM in other libraries or programs only 
  60. if these are Public Domain or Freeware. Anyway this should be done 
  61. only with my consent and their use and origin must be reported in the 
  62. documentation of the software. 
  63.  
  64. Here is what the SmartKeys manual says about HTRIM: 
  65.  
  66. +-------+ 
  67. | HTRIM |           (Homedir-TRIM) 
  68. +-------+ 
  69.  
  70. Need one argument: (1:List) / (1:Real) 
  71.  
  72. It works only in the HOME directory. 
  73.  
  74. If the argument is a List HTRIM orders the variables specified in the 
  75. List as the built-in command ORDER does (the smaller is the List, the 
  76. smaller is the time required), the only difference is that all the 
  77. remaining variables becames hidden: you can still use them as usual 
  78. but they won't appear on the VAR menu and in the List created by the 
  79. VARS command. To hide all the variables use an empty List. If the 
  80. argument is the Real 0, HTRIM bring back to light all the hidden 
  81. variables. This command is very useful to keep clean and tidy the VAR 
  82. menu of the HOME directory. 
  83.  
  84. NOTE: HTRIM makes a complete error check and has worked well under 
  85.       every test I made but, as it deals with a very delicate part of 
  86.       the HP48 Operating System, in some particular case it can cause 
  87.       problems, expecially if you're not using well-written software. 
  88.  
  89. Finally here is the commented source code of the program. 
  90.  
  91. HTRIM 
  92.  
  93. ::                    @ 
  94.  CK1NOLASTWD          @>  need one argument 
  95.  CK&DISPATCH0         @>  it can be a List or a Real 
  96.  FIVE                 @>  List case 
  97.  ::                   @ 
  98.   CONTEXT@            @\  am I in the HOME directory? 
  99.   PTR 08DD4           @/ 
  100.   NOTcase             @\  if not then exit with a 
  101.   PTR 11026           @/  "Directory not Allowed" error 
  102.   '                   @\ 
  103.   SetHiddenRes        @ > create a program (*) to enter the Hidden dir 
  104.   Ob>Seco             @/  (done for the "not well-written software") 
  105.   PTR 15777           @\ 
  106.   DUPDUP              @ > if already exists a variable with the null name 
  107.   @                   @ | that is not the Hidden dir then purge it 
  108.   DROP                @ | 
  109.   TYPERRP?            @ | 
  110.   ITE_DROP            @ | 
  111.   PURGE               @/ 
  112.   CREATE              @>  store the program (*) in a null named variable 
  113.   DUPNULLCOMP?        @\  if the argument is an empty list then exit: 
  114.   caseDROP            @/  all the variables are already hidden 
  115.   ERRSET              @\  order the variables 
  116.   XEQORDER            @/ 
  117.   ERRTRAP             @\ 
  118.   ::                  @ > if the order command cannot perform the 
  119.    PTR 15777          @ | operation and exits with an error then, 
  120.    PURGE              @ | before exiting, purge the null named variable 
  121.    ERRJMP             @ | 
  122.   ;                   @/ 
  123.  ;                    @ 
  124.  ONE                  @>  Real case 
  125.  ::                   @ 
  126.   %0=                 @\  if it's not a 0 then exit with 
  127.   NcaseSIZEERR        @/  a "Bad Argument Value" error 
  128.   PTR 15777           @>  put a null Global Name on the stack 
  129.   SAFE@_HERE          @\ 
  130.   NOT?SEMI            @ > if a null named variable exists in the current 
  131.   TYPERRP?            @ | directory and it does not contain a directory 
  132.   ?SEMI               @ | object then purge it 
  133.   PTR 15777           @ | 
  134.   PURGE               @/ 
  135.  ;                    @ 
  136. ;                     @ 
  137.  
  138.  
  139. I really would like to receive comments, suggestion and/or criticism 
  140. on what I've written. 
  141.  
  142. I hope that my bad english has not caused problems to you. 
  143.  
  144. happy hiding! 
  145.  
  146.                                                             RAP 
  147.  
  148.  
  149. --   
  150.  WolfNet BBS Pisa (Italy) Tel. +39-50-589050 300-14.4K Baud Matrix 2:332/602.0 
  151.  Simone Rapisarda - via FidoNet node 2:33/800 
  152.  UUCP: ...!gear!wolf!332!612!Simone.Rapisarda 
  153.  ARPA: Simone.Rapisarda@f612.n332.z2.fidonet.org 
  154.